#include "pthread_impl.h"

int pthread_mutexattr_settype(pthread_mutexattr_t *a, int type)
{
    if ((a == NULL) || ((unsigned int)type > PTHREAD_MUTEX_ERRORCHECK)) {
        return EINVAL;
    }

    a->__attr = (a->__attr & ~0x00000003) | type;
    return 0;
}